const { defineConfig } = require('@vue/cli-service')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
var webpack = require('webpack');
 
module.exports = defineConfig({
  transpileDependencies: true,
 
  configureWebpack: {
    plugins: [
      new NodePolyfillPlugin(),
      new webpack.ProvidePlugin({
        'window.Quill': 'quill/dist/quill.js',
        'Quill': 'quill/dist/quill.js'
      })
    ],
  },
  devServer: {
    proxy: {
      //配置跨域
      '/api': {
          target: "http://127.0.0.1:1234/",
          ws: false,
          changOrigin: true,
          pathRewrite: {
              '^/api': '/'
          }
      },
      '/socket.io': {
        target: "http://127.0.0.1:3000/",
        ws:true,
        changOrigin: true,
      }
    }
  }
})